/*
 * Systemprogrammierung
 * Multiplayer-Quiz
 *
 * Server
 *
 * clientthread.c: Implementierung des Client-Threads
 */

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "common/util.h"
#include "clientthread.h"
#include <stdint.h>

void clientt_CreateClientThread(uint8_t iUserID) {
	pthread_t oThread;

	infoPrint("\nErstelle neuen ClientThread: %i", (int)iUserID);
	pthread_create(&oThread, NULL, clientt_ClientThread, (void*) &iUserID);
	
	return;
}

void *clientt_ClientThread(void *argument) {
	struct timespec sleepTime;
	struct timespec remainingSleepTime;

	sleepTime.tv_sec=1;
	sleepTime.tv_nsec=500000;

	while (1) {
		//infoPrint("\nClient working...");

		nanosleep(&sleepTime,&remainingSleepTime);
	}

	pthread_exit(0);
}
